Improved isJSON()