Moving the svg animation logic into the success function