Changing socket code