fixed bug in compression