fix for undefined variable