undid flawed socket code