Fixing filedownload bug (introduced during refactor)