Resolve undefined variable notice