Added throwing an error when an invalid temprature is set