save directories and files improved