refactored to fix some race conditions because async!
0.1.3