fix task_handler; fix tests