Added check before deleting old folder.