fixes bug when switching tabs... introduces bug that animation never restarts