Update deprecated function