added debug code to troubleshoot file download