add new lib.js file and fix bug in config