fixed trailing slash bug