fix broken ternary expression