fix bug in mock