restore last directory automation.