add test for request count callback, and fix bug that the test found