More code for db history