fix deprecated method

fix deprecated method.