fix deprecated function