fix fetch logic