changed the controller slightly