put back socket code