Try to avoid race conditions