Fixing the database class