added extra self-dependency check