add index, made changes to class.db.php