Dewey to shut San Francisco base