Replaced usage of deprecated function