updating styling for selected element