Adding some check to avoid errors

heat too