rewrite function fetchAndPassBackToClient