fix bug on nonce check