Updated index.js to work with pin dialog plugin