Add checking external storage before writing a file