improve local path handling