add some interface and close connection when process terminate