Changed send ack to use malloc