move write_history to funcnode.cc was a mistake