added ack logic