ternary operator working