corrected secure_db.py hook