use scandir instead of glob