fixed generateAck to use the current sequence number instead of the
previous