fix the package function