catch exceptions when writing to csv
only sort text files chronologically if queue is exhausted