adapt to the changed APIs