updates to create directory unless file exists