add validation for parent section in pattern file
clear the logic of history
finish the history logic