code_discovery mode bug corrected