Add debug to item writeout