Replace call to deprecated function