main page submit and validation