navigation controller and logic