Fixed bug in the detection of the used modules procedure