path handling improved