Added a check to don't run the last animation block twice