fixed memory leak for assignment of degree 0