correct some bugs and add compress