use function to load file