fix the error from gzip in the with statement