full support of chat notebook
inter-thread communication, removed unnecessary code