Bug fix in discovery