added sorting, but dependency lookup still fails