fix some bugs, create readme.md and add example.js