Converted to use JQuery event handler