fix fetch code