ternary added instead of if