add decode json for pattern match