Check txId on the candidate stale plan after having check the timestamp

- better code for accessing the last tx id