Issue 4 fix create directory if missing function