testing mock function problem