fix ternary