better error handling on form