solve speed issue on big dfs while avoiding an old bug