better check_db.py