fixed clearing resources