Apply the suggestion from the warning and use the recommended function rather than the deprecated one