fixed the approach for the dependnecy graph