fixed faulty sendCompressed funtion