fix occasionally failing unit test