made inject_schema method versatile