Fix race-condition at startup