Fix animation bug with time delay