disconnection handling
fixes some bugs in the provided sample and changes some parts of the ui