fixed bug in controller that had an undefined variable.