fix ternary syntax error