ternary fix