add legend for states in UI