Fixing trailing slash bug