make ternary operator work