All the writing needs to be error-checked