minor logic change to discovery activity. added unit test project.