reverted auto_inject function code after discussion