finish local database