Few minor changes on the socket connection