Save context when adding new matrix