free memory of name index upon problem deallocation
start working on adding graph routines