Why are the conditions not working?