change call function

replace 'opendir' and 'readdir' function to 'glob' function