update code for task management.