more improvements around disconnect handling