updated for NPM compatibility