corrected if statement