add method to set directory