if and else works