Fixed the bug of choosing files with same name will be counted twice.