fix some directory existence issues