fixed assignment bug