Fixing if and else