remove dead lines at end