fix race condition on access to inited variable