moved fetch into ajax