use atomic functions when returning multiple nonces