fix error when form validation fails and renders widget with string valu...

Hi, this fixes an error I encountered.