Fixed bug & optimiza for gzip