fix some race conditions
1.0.2