Updated purchase control template
Updated the download function