add support for controller.prototype.onunload