advcd: Handling the case when folder doesn't exist

To avoid creating history files that don't make sense