adopted to latest API changes