bug fix: segmentation fault: cannot create directory & try to open it.