Avoid using deprecated function