Corrected a sql template