fix animation time calculation bug