fixed matrix allocation in assignment operator