fixed a condition issue