fixing issue of parent dir not being created