parse end of csv correctly