fix onfetch bugs