fix using given directory