fixed bug that if last slash exists, page is not found