fix ternary if