Changed how currentPath is set