fixed gzipping bugs