added log
init socket after getting terminal_id