Undefined Variable Bugfix