fix bug in note page, refactoring