fix some form bugs