chang the if logic