if current matrix is deleted select another