added code to expanduser in case the ~ is used... -sai