creating completed task function