prevent infinite loop when looking recursively for dependencies