remove endings