Add debug to write-out