Fixed error with defined variables