updating for JSON support