update to work with directories and existing files/folders