I think I would just prefer if you move the currentPath declaration into the closure below