Fixed issue #79 and added logic to store nonce and check subsequently to detect replays

Fixed issue #79 and added logic to store nonce and check subsequently to detect replays