Fixed mismatch in if statement