updated to conform to latest API