Fixing warning due to deprecated code