replace obj with arr