fix resetting cache directory if there is no dirname in the current path (empty string)