did more of write file and debugged close