Fix code for add dependency

Remove unnecessary iteration over dependencies.

Signed-off-by: Imran M Yousuf <imyousuf@smitsol.com>