add mainThread handler to the chat core