fix bug in ref line drawing