use os.path.expanduser for dir settings