Avoid race condition