adding socket disconnect handler