fixed some bugs, refactoring +history/pollseal