added analytics and a better validation for form