replace deprecated methods with current api