add test coverage
fix a race condition in test