Added ability to return socket