corrected if condition