fix sql for talk templates