Modulation of resistive switching and magnetism of HfOx film by Co doping