debugging socket issues in app.py and db_operation logic