Fix the ternary operator issue