corrected a bug if the first module is not the exterior one