Not correctly sensing thermal or glass carafe

We use a glass carafe, but the thermal carafe indicator light comes on, the machine brews 3 to 4 cups, then shuts off. If I turn it back on immediately it finishes brewing normally, and the thermal carafe indicator light does not come back on. How does it sense a glass or thermal carafe, and why does it shut off after only a few cups when it is incorrectly sensing a thermal carafe?

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0
crwdns2934285:0crwdne2934285:0