error handling for edit page