Fixing url trimming in setLink