fix validation and form submit