fixed #1 to support QOS 1