adding more checks to autodiscovery