Why conditions are not working properly?