add matrix handler