avoid writing pickle and graph files when one already exists