Updated Celery task for TWS.