fix bugs in assignment