Added error handling to the submission form