Fixed deprecated code