changed the if condition