implement form error handling