fix duplicate element in diagram