fixed bug in resource loader having multiple instances