some works on the database.cpp