Removed isVisible variable, as it might not always be unset correctly (ie, if we call dismissViewController manually on the navigationController)