Avoid flicker by resetting matrix