fixed livelock issue in work_handler.py