Refactoring plugins.js
fix bug plugins.js