correct graph cleanup