Implementing invalid JSON catch method