Fix bug in navigation controller