Why does my condition not work?