bug fix in shuffle: basename -> dirname