Changes in logic for file download