How to get conditions to show/hide properly?