Updating code to use pkgId from request if set