Changed from checking transitionend to checking animation for use with animationend