Made very simple change to data concatenating function that checks if a string is empty before writing to the file. Tested, and it works.