fixed socket code to not harcode localhost