Update db.py

fixed missing type conversion