fix addtomap, do dfs