added support for doing the dfs on the foreign keys