add support for gzip as well (to be optimized)