changed nonce handling