should $linkUri always end with slash? If not then this logic fails if it happens to just be a slash or?