fix syntax error on ternary operator