filter out bad lines