fix(moduleSubGenerator): add conditional checks