Fix empty mds folder bug