added selected class to stream
handling connection detachments