fixed startup race condition