modified for local file loading.