added check for text files with no data