take care of race condition