amendments to fetch in .js