fix extra ends