revised db_helper.py, not tested