fixed bug in navigating between pages