minimize counting error of numberOfMessages in case of simultaneous call with enqueueing