edit error handling