updated to check with JSON,most work in comments