add editor counter
fix bug refresh diagram