workaround for race condition