support init with single string argument for dir