Fix JS error for older versions of jQuery UI