update plugin to work with ES6