fixed crucial bug in jQuery UI code