fix ternary operator