replaced deprecated code