bugs fixed, messages sended before session close are now delivered!