Added functionality to complete a task