Fix query form structure