fixed bug in matrix table