misuse of ternary operator