Add global variable to take care of the animation state.