Fix undefined variable warning on first page load