Updated use of deprecated function