fixes #107 as we were overwriting the key -> node map with the wrong key values