I hate JS race-conditions