Updated controller.py to latest version