fix undefined variable notice