Fixed hardcoded database retrieving in download()