updated for task management logic end to end