Fix bug of removed directory scanning