reworked document injection