Fixed Undefined variables