Fix issue with toggleAnimationClass()