remove invalid lines