Modified context handler for controller.