fixes unit test function