Reworked code to show invalid json