fixed bug in test.js