fixed error catching to only catch ENOENT