Fix fetch function