fixed bug when adding diagram without current diagram