Trying to fix getDirectory()