Fixed bug for navigation to pages