Fix the code of resolving dependency