Bail correctly in submit handler