fixed double resource problem