Added temperature check and control