document disconnect event, fix it clientside