added logic to process submodules