Add Diagram refresh code