implemented ack packet and disconnection