delay before closing db, work in progress