use glob() instead of scandir()