add some implementation of handle_connect_message an wakeup procedure