dir.path refactored so it always ends in a /