bugfixing on mandate.js