fixed issue with iterating over graphs