check before submitting