fix last row error

Fix the error when merging the last row to the attractor matrix