What's your motivation to disable adding new entries to the history in the case that `val` is not a valid page number?