mocha test added, instance count fix