bug fix on db.php