Move download outside to prevent submission