fix require-package function