fix the previous and next navigation