separated the logic flow for assignee mode and manager mode