updated code for one page navigation