fix form error handling