Avoid clashing of animation event listeners with a setTimeout hack