fix test by mocking