fixed bug of sending acknowledgment to client