edit files(handle error)