Add array range check for temperature check