remove some ends