updated the mkdir function