Condition not working after restoring form to a previous time