Adding more checks so that dependencies are not duplicated