Removed use of .on() to make compatible with earlier jQuery versions