updating as_json method