Fix undefined deprecated var