adding socket functionality