improve test.js with limit and interval