finalized the database