catch JSON error when output is an empty string