Fix Undefined Variable Error