Updated the queries to always include dependencies