Corrected error in IF statement