fix dependency handling bug