ternary operator was off