Corrected Undefined variables