fix template and json support