Why condition is not working properly?