Attempt to fix race condition