workaround for remove modules - fixing crash when deleting a module