fix page navigation error when there is no directory