resolved malformed file header when downling the file