fixed bug from matrix position