update error handling and form input