Reset query in template files to avoid double posting