update UI and add number of page function and fix some bugs