write locked routines