added socket.close()