Better accounting for race conditions
Removed console.logs