fix that at every main iteration a new graph instance is created