added file write delay