fix a serious memory bug & message compression