fix some dir bugs