Moved the logic to the success call.