What's wrong in my code? Last condition is not verifying.