fixed toJSON