refactor/change api of chat.messageHandler to put continuation at the last