finish the part of database manager