modify to be able to remember directory.