remove trailing dashes