fix extend_modules_by_deps