improve history record status logic.