Corrected if else statement