Should thermistor be loose in hot-end?

Hi all, I just had a print fail and a nozzle clogged, and finally found the thermistor to be the problem. It had almost worked its way out of the hot-end. There seems to be nothing that holds it in place, except the wires it’s soldered to. The spare hot-end is equally flimsy, thermistor just put in the hole and nothing secures it there. Is this by design? Can I prevent this to fail again with some thermal paste or is it up to fingers crossed and prayers?

An article that was brought up just recently.
You might find it useful.

Thanks! I’ll try some thermal glue.