fixes pretransition bug when using CSS transitions