more stable graph rendering
fix minor memory leak