Fixes racecondition
Merge pull request #4 from ZeissS/race-condition

Fixes racecondition