update animateSVG function