Changed object-based controller, now working properly