add task state change for worker and update in master