autodiscovery calls correct code path