Fixed Undefined Variable Error