add error handling on submit