fixed a bug with gzip and exceptions