better path handling