better control of writing errors