security update: if JSON.parse fails, emits an error instead of quitting app