callback function in loadFile