fixed a bug in building dependency list