Catchillegal json data

Add debug option