fixed #10 - mongodb upsert not waiting for completion