fix unit test crash