fixed some bugs in the loading tool, works better with local files