resolved race condition error