Fix undefined variable notice