continue loop if unable to marshal json, fixes #342