add compress output feature, buggy