add dependency injection to support page.js