added navigation logic