added ability to checkOnSubmit