Fix ResourceManager bug