Moved loading of files to callback function.