fixed the resource problem