fix bug in assignment