pass model to ex_write for debugging