fix bug with mocha