correcting code in SingleWriting and WrittenAtLeastOnce