Changed line to keep bracket consistency
Added functionality to prevent duplicate downloads

Added checks to ensure that another download is not started when the
back button is pressed.

This works by storing a value in a form, which is saved and then
checked once the back button is pressed. If the user chooses to reload
the page (which would be an intentional action) or navigates back to
the main download page and presses the download button again, then the
download still works.