adapt to lib api change