bugfix: date calculation to determine when to perform db back