history tracking using sqlite