added changes according to new api