fixed bugs on the communication protocol with ack's