removed stdout flushing from ack function