Update AnimationHandler.js

This probably fixes the error in #5116