add dependency cycle detection