The sensor from your thermostat should be placed directly on your heat source or you are in serious jepordy of an over temp.

Keeping the heat mat inside the tank is not a standard practice for a verity of reasons.