error handling on submission