fixed animate when the duration is equal to 0