adding class when transitioning