solved IfElse problem