JavaScript bug: break does not work in the jQuery .each loop. Instead, using return false.