JavaScript crash (well, extreme lag)