Fix deprecated api