fix(socket) prevent memory leak