Changed event handlers to the .on opperator