changed structure for download button as there was unnecessary code weirdly structured. adapted for all current templates