typo fix
race condition bug fixed in tests