fix error when form validation fails and renders widget with string value