before pull
fixing merge conflict
add finally block and use tcphandler close() to close socket