Fix for undefined variable