patched for submodule-compatible build