Some error handling in the form