Added file writing delay to minimize the number of times the file is written. Help speeds things up in the UI