implement msg store.
fix disconnected unexpectedly clienti's status handling
fix stack if queue is empty