override to_json method for Record, which makes json output correct