cleanup ending lines