minor enhancement to lib/index.js