Updated for modified API