Corrections to error handling for the 'submitEventHandler' procedure.