fixed potential crash on delete of an ECModule