fix error in not closing the gzip causes the uploaded file unreadable