Added logic to update "completed" property of task