bug fix with dependency check