Fix crash bug and handle navigation title correctly