updated for recent API changes