added form submit validation