added try/catch block that ignores exceptions due to empty document.applets[...] array