replace deprecated code