Update UI correctly if connection is lost immediately after it got established

This is a rare case and should not happen under normal circumstances.