fix a serius bug on the order of depencies hierarchy