Modified the checkInvMat() to have the showMeg argument