problems with dup friend code