Fixed deprecated function