<https://github.com/InsertKoinIO/koin/pull/775>
# koin-contributors
Finally, I've figured out why factory called twice when trying to obtain instance that declared in root scope from a custom scope.
Copy code
private fun <T> findInOtherScope(
    clazz: KClass<*>,
    qualifier: Qualifier?,
    parameters: ParametersDefinition?
): T? {
    return _linkedScope.firstOrNull { scope ->
        scope.getOrNull<T>(
            clazz,
            qualifier,
            parameters
        ) != null
    }?.get(
        clazz,
        qualifier,
        parameters
    )
}
firstOrNull predicate lambda calling scope.getOrNull() and a factory called first time, then if it's not null factory called second time.
a
Great, thanks @scraplesh