add adapter.js and integrate it into code
minor correction