changing graph names to valid names