fixing startup race