tried to fix race condition 1