Revert to previous pkg code, as the master branch needs further testing