handle lineendings