set up submit handler