finished inject function