Better avoiding of race condition