modification for flush db