FIxed

writing to file was async…