Am I missing something, or are you stripping the trailing slash on line 57 and then replacing it here?