My conditions are not working correctly