fix bug where locale would be set incorrectly by what was on the url of the current request