fixed ternary operation