Fixed a bug with an undeclared variable