try catch more file operations