fixed undefined variable