fixed relative URL and trailing slash bug