delete the last , from insert_template