My conditions are not working properly