fix bug when page not set directly