Bug fix for animation