Add delay to avoid race condition