added promise-based file creation