some cleaning
debug write file