updated with the improvement to avoid checking the section change when animating is performing