made fetch a function