fix deprecated code