adapt to api change