protect against bad url segments