fixed typo `waitForWriting`