additions to lib and fix in package.json