Sql typo in historykeeper