updated for json support