getting dir right