function getSocket added