Generating svg only once