mkdirectory function update