updated updateTask in main logic.