Update plugin.js

flatten() missing