fixing load_dir bug