fix form and add validation