fix ifthenelse