Fix undefined variable notice on reload