Fixed bad base in the animationend event