Added function removeTrailingSlash