Updated for change in API