Fixed error in if