adapted to new version of kb api