adapted to new api version