matrix creation fix