was missing an end

inserted end of “if connected loop” right before iView disconnect at
the end