added ternary operator to select tag