fix: memeory leak in matrix print