Better avoiding of race condition (2)