remove trailing slash to prevent double slash in output