removing an extra end