reworked ResourceManager
fixed ResourceManager