adding socket code