fixed name assignment bug