if condition check re-arrangement to allow the iterator validity to be checked first.
added a prev processed event structure to detect the rollback conditions.