remove unused code
fix bug when the page has parent
add hooks test