improved acknowledgement logic