finish database