corrections to the writing routines