Why are my conditions not displaying correctly