update code to fix validate form