Fixed the submodule check logic