fixed undefined variable notice