Adding support for the animation end event