fix some deprecated code