Added functionality for saving last obtaining date into database