fixed Loader related performance issues and memory leaks