catch errors parsing JSON