create root directory in format function