Fixed undefined variables