error handling in the form