added an error handler for setForm