fix some bugs in forms