It won't totally fix the UI problem but I think you should call sched.listener.taskEnded here