add null check for dependencies