fixed #40, also corrects the redirect when the title of a document is changed