made editFile more robust
updated to use named patched with editFile