update the dependency detection logic