added some error handling for no files gathered